﻿using System;
using System.Xml.Serialization;

namespace Altairis.OtpAuth.Core {
    [XmlRoot(ElementName = "otpToken", Namespace = XmlNs.SERIALIZATION_NS_URL)]
    public abstract class OtpToken {

        // Constructors

        protected OtpToken() {
            this.TokenId = Guid.NewGuid();
        }

        // Properties

        [XmlAttribute("id")]
        public Guid TokenId { get; set; }

        [XmlAttribute("name")]
        public string Name { get; set; }

        [XmlElement("description")]
        public string Description { get; set; }

        [XmlAttribute("secret")]
        public byte[] Secret { get; set; }

        // Methods

        public abstract string GenerateCurrentOneTimePassword();

    }
}
